import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  mode: 'history',
  // base: '/h5/',
  routes: [{
    path: '*',
    redirect: '/login'
  }, {
    path: '/login',
    name: 'login',
    component: () => import('@/view/layout/login')
  }, {
    path: '/admin',
    name: 'admin',
    alias: '/',
    component: () => import('@/view/index'),
    children: [{
      path: '',
      name: 'admin',
      meta: {
        name: '管理员登录'
      },
      component: () => import('@/view/admin/main')
    }, {
      path: '/member',
      name: 'member',
      meta: {
        name: '会员管理'
      },
      component: () => import('@/view/member/main')
    }, {
      path: '/company',
      name: 'company',
      meta: {
        name: '公司管理'
      },
      component: () => import('@/view/company/main')
    }, {
      path: '/employee',
      name: 'company',
      meta: {
        name: '公司管理 / 人员信息'
      },
      component: () => import('@/view/company/employee')
    }, {
      path: '/course',
      name: 'course',
      meta: {
        name: '培训课程管理'
      },
      component: () => import('@/view/course/main')
    }, {
      path: '/coursechildren',
      name: 'course',
      meta: {
        name: '培训课程管理 / 培训子课程管理'
      },
      component: () => import('@/view/course/children')
    }, {
      path: '/exam',
      name: 'exam',
      meta: {
        name: '答题模块'
      },
      component: () => import('@/view/exam/main')
    }, {
      path: '/statistics',
      name: 'statistics',
      meta: {
        name: '培训统计'
      },
      component: () => import('@/view/statistics/main')
    }]
  }]
})
